import { _decorator } from 'cc'
import { PARAMS_NAME_ENUM, SPIKES_COUNT_MAP_NUMBER_ENUM } from '../../Enum'
import { SubStateMachine } from '../../Base/SubStateMachine'
const { ccclass, property } = _decorator

/**
 * Predefined variables
 * Name = SpikesSubStateMachine
 * DateTime = Fri Jul 22 2022 16:55:20 GMT+0800 (中国标准时间)
 * Author = Zero_Y
 * FileBasename = SpikesSubStateMachine.ts
 * FileBasenameNoExtension = SpikesSubStateMachine
 * URL = db://assets/Scripts/Spikes/SpikesSubStateMachine.ts
 * ManualUrl = https://docs.cocos.com/creator/3.4/manual/zh/
 *
 */

@ccclass('SpikesSubStateMachine')
export class SpikesSubStateMachine extends SubStateMachine {
  run(): void {
    const value = this.fsm.getParams(PARAMS_NAME_ENUM.SPIKES_CUR_COUNT)
    this.currentState = this.stateMachines.get(SPIKES_COUNT_MAP_NUMBER_ENUM[value as number])
  }
}
